<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>鼠标跟随</title>
    <style>
      img {
        width: 50px;
        position: fixed;
        left: 0;
        top: 0;
      }
    </style>
</head>
<body>
<img src="./屏幕截图%202025-06-08%20100532.png" alt="">
  <script>
    var img = document.querySelector('img');
    document.onmousemove = function (e) {
      var x = e.clientX;
      var y = e.clientY;
      img.style.top = y + 5 + 'px';
      img.style.left = x + 5 + 'px';
    }
  </script>
</body>
</html>